<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>IgH EtherCAT Master: pdo_list.c Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">IgH EtherCAT Master
   &#160;<span id="projectnumber">1.5.2</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',false,false,'search.php','Search');
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('pdo__list_8c_source.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="headertitle">
<div class="title">pdo_list.c</div>  </div>
</div><!--header-->
<div class="contents">
<a href="pdo__list_8c.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">/******************************************************************************</span></div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment"> *  $Id: pdo_list.c,v ec403cf308eb 2013/02/12 14:46:43 fp $</span></div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment"> *  Copyright (C) 2006-2008  Florian Pose, Ingenieurgemeinschaft IgH</span></div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment"> *  This file is part of the IgH EtherCAT Master.</span></div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment"> *  The IgH EtherCAT Master is free software; you can redistribute it and/or</span></div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment"> *  modify it under the terms of the GNU General Public License version 2, as</span></div><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="comment"> *  published by the Free Software Foundation.</span></div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="comment"> *  The IgH EtherCAT Master is distributed in the hope that it will be useful,</span></div><div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="comment"> *  but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div><div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="comment"> *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General</span></div><div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="comment"> *  Public License for more details.</span></div><div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="comment"> *  You should have received a copy of the GNU General Public License along</span></div><div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="comment"> *  with the IgH EtherCAT Master; if not, write to the Free Software</span></div><div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="comment"> *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA</span></div><div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="comment"> *  ---</span></div><div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="comment"> *  The license mentioned above concerns the source code only. Using the</span></div><div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;<span class="comment"> *  EtherCAT technology and brand is only permitted in compliance with the</span></div><div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;<span class="comment"> *  industrial property and similar rights of Beckhoff Automation GmbH.</span></div><div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;<span class="comment"> *****************************************************************************/</span></div><div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;</div><div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;<span class="comment">/*****************************************************************************/</span></div><div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;</div><div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;<span class="preprocessor">#include &lt;linux/module.h&gt;</span></div><div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;</div><div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="globals_8h.html">globals.h</a>&quot;</span></div><div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="pdo_8h.html">pdo.h</a>&quot;</span></div><div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="slave__config_8h.html">slave_config.h</a>&quot;</span></div><div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="master_8h.html">master.h</a>&quot;</span></div><div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;</div><div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="pdo__list_8h.html">pdo_list.h</a>&quot;</span></div><div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;</div><div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;<span class="comment">/*****************************************************************************/</span></div><div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;</div><div class="line"><a name="l00050"></a><span class="lineno"><a class="line" href="pdo__list_8h.html#aee1095c2e92c859063b1ed782e5bf7d6">   50</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="pdo__list_8c.html#ac6f343a6f07a1f817fc0c8820fbd5314">ec_pdo_list_init</a>(</div><div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;        <a class="code" href="structec__pdo__list__t.html">ec_pdo_list_t</a> *pl </div><div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;        )</div><div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;{</div><div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;    INIT_LIST_HEAD(&amp;pl-&gt;<a class="code" href="structec__pdo__list__t.html#a7889b3f485d92c496fd15e45573cae21">list</a>);</div><div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;}</div><div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;</div><div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;<span class="comment">/*****************************************************************************/</span></div><div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;</div><div class="line"><a name="l00061"></a><span class="lineno"><a class="line" href="pdo__list_8h.html#aa9f079345fae9a1b8ceb9d142ff41368">   61</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="pdo__list_8c.html#a30f05a34cf44b4d4f5bd47db39addb95">ec_pdo_list_clear</a>(<a class="code" href="structec__pdo__list__t.html">ec_pdo_list_t</a> *pl )</div><div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;{</div><div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;    <a class="code" href="pdo__list_8c.html#aff8b6a50972c7106457f0db17fbeaf6c">ec_pdo_list_clear_pdos</a>(pl);</div><div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;}</div><div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;</div><div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;<span class="comment">/*****************************************************************************/</span></div><div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;</div><div class="line"><a name="l00070"></a><span class="lineno"><a class="line" href="pdo__list_8h.html#a6b1d3da4ada951f662be5dc4c8519026">   70</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="pdo__list_8c.html#aff8b6a50972c7106457f0db17fbeaf6c">ec_pdo_list_clear_pdos</a>(<a class="code" href="structec__pdo__list__t.html">ec_pdo_list_t</a> *pl )</div><div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;{</div><div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;    <a class="code" href="structec__pdo__t.html">ec_pdo_t</a> *pdo, *next;</div><div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;</div><div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;    list_for_each_entry_safe(pdo, next, &amp;pl-&gt;<a class="code" href="structec__pdo__list__t.html#a7889b3f485d92c496fd15e45573cae21">list</a>, list) {</div><div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;        list_del_init(&amp;pdo-&gt;<a class="code" href="structec__pdo__t.html#aa7e6a0e0405c93414052c6d998d604ad">list</a>);</div><div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;        <a class="code" href="pdo_8c.html#a2fdbc33334b65a05865e9df69df1737c">ec_pdo_clear</a>(pdo);</div><div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;        kfree(pdo);</div><div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;    }</div><div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;}</div><div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;</div><div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;<span class="comment">/*****************************************************************************/</span></div><div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;</div><div class="line"><a name="l00087"></a><span class="lineno"><a class="line" href="pdo__list_8h.html#a942de0a05c5cdcea43f595d2ff38387b">   87</a></span>&#160;uint16_t <a class="code" href="pdo__list_8c.html#a464a658cdd2744493d9e63d033db4d36">ec_pdo_list_total_size</a>(</div><div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;        <span class="keyword">const</span> <a class="code" href="structec__pdo__list__t.html">ec_pdo_list_t</a> *pl </div><div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;        )</div><div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;{</div><div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;    <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> bit_size;</div><div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;    <span class="keyword">const</span> <a class="code" href="structec__pdo__t.html">ec_pdo_t</a> *pdo;</div><div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;    <span class="keyword">const</span> <a class="code" href="structec__pdo__entry__t.html">ec_pdo_entry_t</a> *pdo_entry;</div><div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;    uint16_t byte_size;</div><div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;</div><div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;    bit_size = 0;</div><div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;    list_for_each_entry(pdo, &amp;pl-&gt;<a class="code" href="structec__pdo__list__t.html#a7889b3f485d92c496fd15e45573cae21">list</a>, list) {</div><div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;        list_for_each_entry(pdo_entry, &amp;pdo-&gt;<a class="code" href="structec__pdo__t.html#aaac321c4f80081e5f69e2ff30eac80e5">entries</a>, list) {</div><div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;            bit_size += pdo_entry-&gt;<a class="code" href="structec__pdo__entry__t.html#a589e58c4f0eb47d8916a3da125d09176">bit_length</a>;</div><div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;        }</div><div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;    }</div><div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;</div><div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;    <span class="keywordflow">if</span> (bit_size % 8) <span class="comment">// round up to full bytes</span></div><div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;        byte_size = bit_size / 8 + 1;</div><div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;    <span class="keywordflow">else</span></div><div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;        byte_size = bit_size / 8;</div><div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;</div><div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;    <span class="keywordflow">return</span> byte_size;</div><div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;}</div><div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;</div><div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;<span class="comment">/*****************************************************************************/</span></div><div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;</div><div class="line"><a name="l00117"></a><span class="lineno"><a class="line" href="pdo__list_8h.html#a289f67d8c8bb5978608d213916fe7fb9">  117</a></span>&#160;<a class="code" href="structec__pdo__t.html">ec_pdo_t</a> *<a class="code" href="pdo__list_8c.html#a19d7263b2fa2234b9d8301515528e834">ec_pdo_list_add_pdo</a>(</div><div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;        <a class="code" href="structec__pdo__list__t.html">ec_pdo_list_t</a> *pl, </div><div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;        uint16_t index </div><div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;        )</div><div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;{</div><div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;    <a class="code" href="structec__pdo__t.html">ec_pdo_t</a> *pdo;</div><div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;</div><div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;    <span class="keywordflow">if</span> (!(pdo = (<a class="code" href="structec__pdo__t.html">ec_pdo_t</a> *) kmalloc(<span class="keyword">sizeof</span>(<a class="code" href="structec__pdo__t.html">ec_pdo_t</a>), GFP_KERNEL))) {</div><div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;        <a class="code" href="globals_8h.html#aed23297031f2f23bb5d005bb586790cf">EC_ERR</a>(<span class="stringliteral">&quot;Failed to allocate memory for PDO.\n&quot;</span>);</div><div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;        <span class="keywordflow">return</span> ERR_PTR(-ENOMEM);</div><div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;    }</div><div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;</div><div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;    <a class="code" href="pdo_8c.html#a0766e8e7b4f607aa3b8ce3320198c23b">ec_pdo_init</a>(pdo);</div><div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;    pdo-&gt;<a class="code" href="structec__pdo__t.html#ae319ba9b8bed2ac49cf6596ff690cfdd">index</a> = index;</div><div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;    list_add_tail(&amp;pdo-&gt;<a class="code" href="structec__pdo__t.html#aa7e6a0e0405c93414052c6d998d604ad">list</a>, &amp;pl-&gt;<a class="code" href="structec__pdo__list__t.html#a7889b3f485d92c496fd15e45573cae21">list</a>);</div><div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;    <span class="keywordflow">return</span> pdo;</div><div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;}</div><div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;</div><div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;<span class="comment">/*****************************************************************************/</span></div><div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;</div><div class="line"><a name="l00141"></a><span class="lineno"><a class="line" href="pdo__list_8h.html#a0ce0c1d5b23d99d13b24acb4cb4b0cd7">  141</a></span>&#160;<span class="keywordtype">int</span> <a class="code" href="pdo__list_8c.html#a1e0dfffa35df484b25834003b447e888">ec_pdo_list_add_pdo_copy</a>(</div><div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;        <a class="code" href="structec__pdo__list__t.html">ec_pdo_list_t</a> *pl, </div><div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;        <span class="keyword">const</span> <a class="code" href="structec__pdo__t.html">ec_pdo_t</a> *pdo </div><div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;        )</div><div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;{</div><div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;    <a class="code" href="structec__pdo__t.html">ec_pdo_t</a> *mapped_pdo;</div><div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;    <span class="keywordtype">int</span> ret;</div><div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160;</div><div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;    <span class="comment">// PDO already mapped?</span></div><div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160;    list_for_each_entry(mapped_pdo, &amp;pl-&gt;<a class="code" href="structec__pdo__list__t.html#a7889b3f485d92c496fd15e45573cae21">list</a>, list) {</div><div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;        <span class="keywordflow">if</span> (mapped_pdo-&gt;<a class="code" href="structec__pdo__t.html#ae319ba9b8bed2ac49cf6596ff690cfdd">index</a> != pdo-&gt;<a class="code" href="structec__pdo__t.html#ae319ba9b8bed2ac49cf6596ff690cfdd">index</a>) <span class="keywordflow">continue</span>;</div><div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;        <a class="code" href="globals_8h.html#aed23297031f2f23bb5d005bb586790cf">EC_ERR</a>(<span class="stringliteral">&quot;PDO 0x%04X is already mapped!\n&quot;</span>, pdo-&gt;<a class="code" href="structec__pdo__t.html#ae319ba9b8bed2ac49cf6596ff690cfdd">index</a>);</div><div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;        <span class="keywordflow">return</span> -EEXIST;</div><div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;    }</div><div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160;</div><div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160;    <span class="keywordflow">if</span> (!(mapped_pdo = kmalloc(<span class="keyword">sizeof</span>(<a class="code" href="structec__pdo__t.html">ec_pdo_t</a>), GFP_KERNEL))) {</div><div class="line"><a name="l00157"></a><span class="lineno">  157</span>&#160;        <a class="code" href="globals_8h.html#aed23297031f2f23bb5d005bb586790cf">EC_ERR</a>(<span class="stringliteral">&quot;Failed to allocate PDO memory.\n&quot;</span>);</div><div class="line"><a name="l00158"></a><span class="lineno">  158</span>&#160;        <span class="keywordflow">return</span> -ENOMEM;</div><div class="line"><a name="l00159"></a><span class="lineno">  159</span>&#160;    }</div><div class="line"><a name="l00160"></a><span class="lineno">  160</span>&#160;</div><div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160;    ret = <a class="code" href="pdo_8c.html#aa3110f0f43df1aa859a25a7a53be431c">ec_pdo_init_copy</a>(mapped_pdo, pdo);</div><div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160;    <span class="keywordflow">if</span> (ret &lt; 0) {</div><div class="line"><a name="l00163"></a><span class="lineno">  163</span>&#160;        kfree(mapped_pdo);</div><div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160;        <span class="keywordflow">return</span> ret;</div><div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160;    }</div><div class="line"><a name="l00166"></a><span class="lineno">  166</span>&#160;</div><div class="line"><a name="l00167"></a><span class="lineno">  167</span>&#160;    list_add_tail(&amp;mapped_pdo-&gt;<a class="code" href="structec__pdo__t.html#aa7e6a0e0405c93414052c6d998d604ad">list</a>, &amp;pl-&gt;<a class="code" href="structec__pdo__list__t.html#a7889b3f485d92c496fd15e45573cae21">list</a>);</div><div class="line"><a name="l00168"></a><span class="lineno">  168</span>&#160;    <span class="keywordflow">return</span> 0;</div><div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160;}</div><div class="line"><a name="l00170"></a><span class="lineno">  170</span>&#160;</div><div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;<span class="comment">/*****************************************************************************/</span></div><div class="line"><a name="l00172"></a><span class="lineno">  172</span>&#160;</div><div class="line"><a name="l00177"></a><span class="lineno"><a class="line" href="pdo__list_8h.html#adc6f43356c29fa3e62c9178264fb3c39">  177</a></span>&#160;<span class="keywordtype">int</span> <a class="code" href="pdo__list_8c.html#accc8112633a4b76efe8df355d1ad0ec8">ec_pdo_list_copy</a>(</div><div class="line"><a name="l00178"></a><span class="lineno">  178</span>&#160;        <a class="code" href="structec__pdo__list__t.html">ec_pdo_list_t</a> *pl, </div><div class="line"><a name="l00179"></a><span class="lineno">  179</span>&#160;        <span class="keyword">const</span> <a class="code" href="structec__pdo__list__t.html">ec_pdo_list_t</a> *other </div><div class="line"><a name="l00180"></a><span class="lineno">  180</span>&#160;        )</div><div class="line"><a name="l00181"></a><span class="lineno">  181</span>&#160;{</div><div class="line"><a name="l00182"></a><span class="lineno">  182</span>&#160;    <a class="code" href="structec__pdo__t.html">ec_pdo_t</a> *other_pdo;</div><div class="line"><a name="l00183"></a><span class="lineno">  183</span>&#160;    <span class="keywordtype">int</span> ret;</div><div class="line"><a name="l00184"></a><span class="lineno">  184</span>&#160;</div><div class="line"><a name="l00185"></a><span class="lineno">  185</span>&#160;    <a class="code" href="pdo__list_8c.html#aff8b6a50972c7106457f0db17fbeaf6c">ec_pdo_list_clear_pdos</a>(pl);</div><div class="line"><a name="l00186"></a><span class="lineno">  186</span>&#160;</div><div class="line"><a name="l00187"></a><span class="lineno">  187</span>&#160;    <span class="comment">// PDO already mapped?</span></div><div class="line"><a name="l00188"></a><span class="lineno">  188</span>&#160;    list_for_each_entry(other_pdo, &amp;other-&gt;<a class="code" href="structec__pdo__list__t.html#a7889b3f485d92c496fd15e45573cae21">list</a>, list) {</div><div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160;        ret = <a class="code" href="pdo__list_8c.html#a1e0dfffa35df484b25834003b447e888">ec_pdo_list_add_pdo_copy</a>(pl, other_pdo);</div><div class="line"><a name="l00190"></a><span class="lineno">  190</span>&#160;        <span class="keywordflow">if</span> (ret)</div><div class="line"><a name="l00191"></a><span class="lineno">  191</span>&#160;            <span class="keywordflow">return</span> ret;</div><div class="line"><a name="l00192"></a><span class="lineno">  192</span>&#160;    }</div><div class="line"><a name="l00193"></a><span class="lineno">  193</span>&#160;</div><div class="line"><a name="l00194"></a><span class="lineno">  194</span>&#160;    <span class="keywordflow">return</span> 0;</div><div class="line"><a name="l00195"></a><span class="lineno">  195</span>&#160;}</div><div class="line"><a name="l00196"></a><span class="lineno">  196</span>&#160;</div><div class="line"><a name="l00197"></a><span class="lineno">  197</span>&#160;<span class="comment">/*****************************************************************************/</span></div><div class="line"><a name="l00198"></a><span class="lineno">  198</span>&#160;</div><div class="line"><a name="l00207"></a><span class="lineno"><a class="line" href="pdo__list_8h.html#ac4442e6596e4034f09bac0fbf6eb2821">  207</a></span>&#160;<span class="keywordtype">int</span> <a class="code" href="pdo__list_8c.html#ac05fc5ee2cf2afdf8b8501ef194c4002">ec_pdo_list_equal</a>(</div><div class="line"><a name="l00208"></a><span class="lineno">  208</span>&#160;        <span class="keyword">const</span> <a class="code" href="structec__pdo__list__t.html">ec_pdo_list_t</a> *pl1, </div><div class="line"><a name="l00209"></a><span class="lineno">  209</span>&#160;        <span class="keyword">const</span> <a class="code" href="structec__pdo__list__t.html">ec_pdo_list_t</a> *pl2 </div><div class="line"><a name="l00210"></a><span class="lineno">  210</span>&#160;        )</div><div class="line"><a name="l00211"></a><span class="lineno">  211</span>&#160;{</div><div class="line"><a name="l00212"></a><span class="lineno">  212</span>&#160;    <span class="keyword">const</span> <span class="keyword">struct </span>list_head *h1, *h2, *l1, *l2;</div><div class="line"><a name="l00213"></a><span class="lineno">  213</span>&#160;    <span class="keyword">const</span> <a class="code" href="structec__pdo__t.html">ec_pdo_t</a> *p1, *p2;</div><div class="line"><a name="l00214"></a><span class="lineno">  214</span>&#160;</div><div class="line"><a name="l00215"></a><span class="lineno">  215</span>&#160;    h1 = l1 = &amp;pl1-&gt;<a class="code" href="structec__pdo__list__t.html#a7889b3f485d92c496fd15e45573cae21">list</a>;</div><div class="line"><a name="l00216"></a><span class="lineno">  216</span>&#160;    h2 = l2 = &amp;pl2-&gt;<a class="code" href="structec__pdo__list__t.html#a7889b3f485d92c496fd15e45573cae21">list</a>;</div><div class="line"><a name="l00217"></a><span class="lineno">  217</span>&#160;</div><div class="line"><a name="l00218"></a><span class="lineno">  218</span>&#160;    <span class="keywordflow">while</span> (1) {</div><div class="line"><a name="l00219"></a><span class="lineno">  219</span>&#160;        l1 = l1-&gt;next;</div><div class="line"><a name="l00220"></a><span class="lineno">  220</span>&#160;        l2 = l2-&gt;next;</div><div class="line"><a name="l00221"></a><span class="lineno">  221</span>&#160;</div><div class="line"><a name="l00222"></a><span class="lineno">  222</span>&#160;        <span class="keywordflow">if</span> ((l1 == h1) ^ (l2 == h2)) <span class="comment">// unequal lengths</span></div><div class="line"><a name="l00223"></a><span class="lineno">  223</span>&#160;            <span class="keywordflow">return</span> 0;</div><div class="line"><a name="l00224"></a><span class="lineno">  224</span>&#160;        <span class="keywordflow">if</span> (l1 == h1) <span class="comment">// both finished</span></div><div class="line"><a name="l00225"></a><span class="lineno">  225</span>&#160;            <span class="keywordflow">break</span>;</div><div class="line"><a name="l00226"></a><span class="lineno">  226</span>&#160;</div><div class="line"><a name="l00227"></a><span class="lineno">  227</span>&#160;        p1 = list_entry(l1, <a class="code" href="structec__pdo__t.html">ec_pdo_t</a>, list);</div><div class="line"><a name="l00228"></a><span class="lineno">  228</span>&#160;        p2 = list_entry(l2, <a class="code" href="structec__pdo__t.html">ec_pdo_t</a>, list);</div><div class="line"><a name="l00229"></a><span class="lineno">  229</span>&#160;</div><div class="line"><a name="l00230"></a><span class="lineno">  230</span>&#160;        <span class="keywordflow">if</span> (p1-&gt;<a class="code" href="structec__pdo__t.html#ae319ba9b8bed2ac49cf6596ff690cfdd">index</a> != p2-&gt;<a class="code" href="structec__pdo__t.html#ae319ba9b8bed2ac49cf6596ff690cfdd">index</a>)</div><div class="line"><a name="l00231"></a><span class="lineno">  231</span>&#160;            <span class="keywordflow">return</span> 0;</div><div class="line"><a name="l00232"></a><span class="lineno">  232</span>&#160;    }</div><div class="line"><a name="l00233"></a><span class="lineno">  233</span>&#160;</div><div class="line"><a name="l00234"></a><span class="lineno">  234</span>&#160;    <span class="keywordflow">return</span> 1;</div><div class="line"><a name="l00235"></a><span class="lineno">  235</span>&#160;}</div><div class="line"><a name="l00236"></a><span class="lineno">  236</span>&#160;</div><div class="line"><a name="l00237"></a><span class="lineno">  237</span>&#160;<span class="comment">/*****************************************************************************/</span></div><div class="line"><a name="l00238"></a><span class="lineno">  238</span>&#160;</div><div class="line"><a name="l00243"></a><span class="lineno"><a class="line" href="pdo__list_8h.html#a622aeac2fc2707331ccf4a25f0250e74">  243</a></span>&#160;<a class="code" href="structec__pdo__t.html">ec_pdo_t</a> *<a class="code" href="pdo__list_8c.html#ab08f37fcf3beda7d5425d49eca02c3be">ec_pdo_list_find_pdo</a>(</div><div class="line"><a name="l00244"></a><span class="lineno">  244</span>&#160;        <span class="keyword">const</span> <a class="code" href="structec__pdo__list__t.html">ec_pdo_list_t</a> *pl, </div><div class="line"><a name="l00245"></a><span class="lineno">  245</span>&#160;        uint16_t index </div><div class="line"><a name="l00246"></a><span class="lineno">  246</span>&#160;        )</div><div class="line"><a name="l00247"></a><span class="lineno">  247</span>&#160;{</div><div class="line"><a name="l00248"></a><span class="lineno">  248</span>&#160;    <a class="code" href="structec__pdo__t.html">ec_pdo_t</a> *pdo;</div><div class="line"><a name="l00249"></a><span class="lineno">  249</span>&#160;</div><div class="line"><a name="l00250"></a><span class="lineno">  250</span>&#160;    list_for_each_entry(pdo, &amp;pl-&gt;<a class="code" href="structec__pdo__list__t.html#a7889b3f485d92c496fd15e45573cae21">list</a>, list) {</div><div class="line"><a name="l00251"></a><span class="lineno">  251</span>&#160;        <span class="keywordflow">if</span> (pdo-&gt;<a class="code" href="structec__pdo__t.html#ae319ba9b8bed2ac49cf6596ff690cfdd">index</a> != index)</div><div class="line"><a name="l00252"></a><span class="lineno">  252</span>&#160;            <span class="keywordflow">continue</span>;</div><div class="line"><a name="l00253"></a><span class="lineno">  253</span>&#160;        <span class="keywordflow">return</span> pdo;</div><div class="line"><a name="l00254"></a><span class="lineno">  254</span>&#160;    }</div><div class="line"><a name="l00255"></a><span class="lineno">  255</span>&#160;</div><div class="line"><a name="l00256"></a><span class="lineno">  256</span>&#160;    <span class="keywordflow">return</span> NULL;</div><div class="line"><a name="l00257"></a><span class="lineno">  257</span>&#160;}</div><div class="line"><a name="l00258"></a><span class="lineno">  258</span>&#160;</div><div class="line"><a name="l00259"></a><span class="lineno">  259</span>&#160;<span class="comment">/*****************************************************************************/</span></div><div class="line"><a name="l00260"></a><span class="lineno">  260</span>&#160;</div><div class="line"><a name="l00265"></a><span class="lineno"><a class="line" href="pdo__list_8h.html#a6fc81f6e6401f70beb9686eb6ac11ed2">  265</a></span>&#160;<span class="keyword">const</span> <a class="code" href="structec__pdo__t.html">ec_pdo_t</a> *<a class="code" href="pdo__list_8c.html#a0bffe5f1347255244f09ed77db2f4285">ec_pdo_list_find_pdo_const</a>(</div><div class="line"><a name="l00266"></a><span class="lineno">  266</span>&#160;        <span class="keyword">const</span> <a class="code" href="structec__pdo__list__t.html">ec_pdo_list_t</a> *pl, </div><div class="line"><a name="l00267"></a><span class="lineno">  267</span>&#160;        uint16_t index </div><div class="line"><a name="l00268"></a><span class="lineno">  268</span>&#160;        )</div><div class="line"><a name="l00269"></a><span class="lineno">  269</span>&#160;{</div><div class="line"><a name="l00270"></a><span class="lineno">  270</span>&#160;    <span class="keyword">const</span> <a class="code" href="structec__pdo__t.html">ec_pdo_t</a> *pdo;</div><div class="line"><a name="l00271"></a><span class="lineno">  271</span>&#160;</div><div class="line"><a name="l00272"></a><span class="lineno">  272</span>&#160;    list_for_each_entry(pdo, &amp;pl-&gt;<a class="code" href="structec__pdo__list__t.html#a7889b3f485d92c496fd15e45573cae21">list</a>, list) {</div><div class="line"><a name="l00273"></a><span class="lineno">  273</span>&#160;        <span class="keywordflow">if</span> (pdo-&gt;<a class="code" href="structec__pdo__t.html#ae319ba9b8bed2ac49cf6596ff690cfdd">index</a> != index)</div><div class="line"><a name="l00274"></a><span class="lineno">  274</span>&#160;            <span class="keywordflow">continue</span>;</div><div class="line"><a name="l00275"></a><span class="lineno">  275</span>&#160;        <span class="keywordflow">return</span> pdo;</div><div class="line"><a name="l00276"></a><span class="lineno">  276</span>&#160;    }</div><div class="line"><a name="l00277"></a><span class="lineno">  277</span>&#160;</div><div class="line"><a name="l00278"></a><span class="lineno">  278</span>&#160;    <span class="keywordflow">return</span> NULL;</div><div class="line"><a name="l00279"></a><span class="lineno">  279</span>&#160;}</div><div class="line"><a name="l00280"></a><span class="lineno">  280</span>&#160;</div><div class="line"><a name="l00281"></a><span class="lineno">  281</span>&#160;<span class="comment">/*****************************************************************************/</span></div><div class="line"><a name="l00282"></a><span class="lineno">  282</span>&#160;</div><div class="line"><a name="l00289"></a><span class="lineno"><a class="line" href="pdo__list_8h.html#acc0eb92da1b63278a6b7a2f7e9d30f6b">  289</a></span>&#160;<span class="keyword">const</span> <a class="code" href="structec__pdo__t.html">ec_pdo_t</a> *<a class="code" href="pdo__list_8c.html#af7e65b2de439049f0f2b2cdfd1618187">ec_pdo_list_find_pdo_by_pos_const</a>(</div><div class="line"><a name="l00290"></a><span class="lineno">  290</span>&#160;        <span class="keyword">const</span> <a class="code" href="structec__pdo__list__t.html">ec_pdo_list_t</a> *pl, </div><div class="line"><a name="l00291"></a><span class="lineno">  291</span>&#160;        <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> pos </div><div class="line"><a name="l00292"></a><span class="lineno">  292</span>&#160;        )</div><div class="line"><a name="l00293"></a><span class="lineno">  293</span>&#160;{</div><div class="line"><a name="l00294"></a><span class="lineno">  294</span>&#160;    <span class="keyword">const</span> <a class="code" href="structec__pdo__t.html">ec_pdo_t</a> *pdo;</div><div class="line"><a name="l00295"></a><span class="lineno">  295</span>&#160;</div><div class="line"><a name="l00296"></a><span class="lineno">  296</span>&#160;    list_for_each_entry(pdo, &amp;pl-&gt;<a class="code" href="structec__pdo__list__t.html#a7889b3f485d92c496fd15e45573cae21">list</a>, list) {</div><div class="line"><a name="l00297"></a><span class="lineno">  297</span>&#160;        <span class="keywordflow">if</span> (pos--)</div><div class="line"><a name="l00298"></a><span class="lineno">  298</span>&#160;            <span class="keywordflow">continue</span>;</div><div class="line"><a name="l00299"></a><span class="lineno">  299</span>&#160;        <span class="keywordflow">return</span> pdo;</div><div class="line"><a name="l00300"></a><span class="lineno">  300</span>&#160;    }</div><div class="line"><a name="l00301"></a><span class="lineno">  301</span>&#160;</div><div class="line"><a name="l00302"></a><span class="lineno">  302</span>&#160;    <span class="keywordflow">return</span> NULL;</div><div class="line"><a name="l00303"></a><span class="lineno">  303</span>&#160;}</div><div class="line"><a name="l00304"></a><span class="lineno">  304</span>&#160;</div><div class="line"><a name="l00305"></a><span class="lineno">  305</span>&#160;<span class="comment">/*****************************************************************************/</span></div><div class="line"><a name="l00306"></a><span class="lineno">  306</span>&#160;</div><div class="line"><a name="l00311"></a><span class="lineno"><a class="line" href="pdo__list_8h.html#a1b62a9bbe8dd2779c47b7f17208958f3">  311</a></span>&#160;<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="pdo__list_8c.html#a6cdf2367204e4db2dcdac339be67aaed">ec_pdo_list_count</a>(</div><div class="line"><a name="l00312"></a><span class="lineno">  312</span>&#160;        <span class="keyword">const</span> <a class="code" href="structec__pdo__list__t.html">ec_pdo_list_t</a> *pl </div><div class="line"><a name="l00313"></a><span class="lineno">  313</span>&#160;        )</div><div class="line"><a name="l00314"></a><span class="lineno">  314</span>&#160;{</div><div class="line"><a name="l00315"></a><span class="lineno">  315</span>&#160;    <span class="keyword">const</span> <a class="code" href="structec__pdo__t.html">ec_pdo_t</a> *pdo;</div><div class="line"><a name="l00316"></a><span class="lineno">  316</span>&#160;    <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> num = 0;</div><div class="line"><a name="l00317"></a><span class="lineno">  317</span>&#160;</div><div class="line"><a name="l00318"></a><span class="lineno">  318</span>&#160;    list_for_each_entry(pdo, &amp;pl-&gt;<a class="code" href="structec__pdo__list__t.html#a7889b3f485d92c496fd15e45573cae21">list</a>, list) {</div><div class="line"><a name="l00319"></a><span class="lineno">  319</span>&#160;        num++;</div><div class="line"><a name="l00320"></a><span class="lineno">  320</span>&#160;    }</div><div class="line"><a name="l00321"></a><span class="lineno">  321</span>&#160;</div><div class="line"><a name="l00322"></a><span class="lineno">  322</span>&#160;    <span class="keywordflow">return</span> num;</div><div class="line"><a name="l00323"></a><span class="lineno">  323</span>&#160;}</div><div class="line"><a name="l00324"></a><span class="lineno">  324</span>&#160;</div><div class="line"><a name="l00325"></a><span class="lineno">  325</span>&#160;<span class="comment">/*****************************************************************************/</span></div><div class="line"><a name="l00326"></a><span class="lineno">  326</span>&#160;</div><div class="line"><a name="l00329"></a><span class="lineno"><a class="line" href="pdo__list_8h.html#ac7e42782cb2774a74ffd38e792e7da7c">  329</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="pdo__list_8c.html#a75bc7cee35f668b62965ba2c010b82dd">ec_pdo_list_print</a>(</div><div class="line"><a name="l00330"></a><span class="lineno">  330</span>&#160;        <span class="keyword">const</span> <a class="code" href="structec__pdo__list__t.html">ec_pdo_list_t</a> *pl </div><div class="line"><a name="l00331"></a><span class="lineno">  331</span>&#160;        )</div><div class="line"><a name="l00332"></a><span class="lineno">  332</span>&#160;{</div><div class="line"><a name="l00333"></a><span class="lineno">  333</span>&#160;    <span class="keyword">const</span> <a class="code" href="structec__pdo__t.html">ec_pdo_t</a> *pdo;</div><div class="line"><a name="l00334"></a><span class="lineno">  334</span>&#160;</div><div class="line"><a name="l00335"></a><span class="lineno">  335</span>&#160;    <span class="keywordflow">if</span> (list_empty(&amp;pl-&gt;<a class="code" href="structec__pdo__list__t.html#a7889b3f485d92c496fd15e45573cae21">list</a>)) {</div><div class="line"><a name="l00336"></a><span class="lineno">  336</span>&#160;        printk(<span class="stringliteral">&quot;(none)&quot;</span>);</div><div class="line"><a name="l00337"></a><span class="lineno">  337</span>&#160;    } <span class="keywordflow">else</span> {</div><div class="line"><a name="l00338"></a><span class="lineno">  338</span>&#160;        list_for_each_entry(pdo, &amp;pl-&gt;<a class="code" href="structec__pdo__list__t.html#a7889b3f485d92c496fd15e45573cae21">list</a>, list) {</div><div class="line"><a name="l00339"></a><span class="lineno">  339</span>&#160;            printk(<span class="stringliteral">&quot;0x%04X&quot;</span>, pdo-&gt;<a class="code" href="structec__pdo__t.html#ae319ba9b8bed2ac49cf6596ff690cfdd">index</a>);</div><div class="line"><a name="l00340"></a><span class="lineno">  340</span>&#160;            <span class="keywordflow">if</span> (pdo-&gt;<a class="code" href="structec__pdo__t.html#aa7e6a0e0405c93414052c6d998d604ad">list</a>.next != &amp;pl-&gt;<a class="code" href="structec__pdo__list__t.html#a7889b3f485d92c496fd15e45573cae21">list</a>)</div><div class="line"><a name="l00341"></a><span class="lineno">  341</span>&#160;                printk(<span class="stringliteral">&quot; &quot;</span>);</div><div class="line"><a name="l00342"></a><span class="lineno">  342</span>&#160;        }</div><div class="line"><a name="l00343"></a><span class="lineno">  343</span>&#160;    }</div><div class="line"><a name="l00344"></a><span class="lineno">  344</span>&#160;}</div><div class="line"><a name="l00345"></a><span class="lineno">  345</span>&#160;</div><div class="line"><a name="l00346"></a><span class="lineno">  346</span>&#160;<span class="comment">/*****************************************************************************/</span></div><div class="ttc" id="structec__pdo__list__t_html"><div class="ttname"><a href="structec__pdo__list__t.html">ec_pdo_list_t</a></div><div class="ttdoc">EtherCAT PDO list. </div><div class="ttdef"><b>Definition:</b> <a href="pdo__list_8h_source.html#l00049">pdo_list.h:49</a></div></div>
<div class="ttc" id="pdo__list_8c_html_a0bffe5f1347255244f09ed77db2f4285"><div class="ttname"><a href="pdo__list_8c.html#a0bffe5f1347255244f09ed77db2f4285">ec_pdo_list_find_pdo_const</a></div><div class="ttdeci">const ec_pdo_t * ec_pdo_list_find_pdo_const(const ec_pdo_list_t *pl, uint16_t index)</div><div class="ttdoc">Finds a PDO with the given index and returns a const pointer. </div><div class="ttdef"><b>Definition:</b> <a href="pdo__list_8c_source.html#l00265">pdo_list.c:265</a></div></div>
<div class="ttc" id="pdo__list_8c_html_a75bc7cee35f668b62965ba2c010b82dd"><div class="ttname"><a href="pdo__list_8c.html#a75bc7cee35f668b62965ba2c010b82dd">ec_pdo_list_print</a></div><div class="ttdeci">void ec_pdo_list_print(const ec_pdo_list_t *pl)</div><div class="ttdoc">Outputs the PDOs in the list. </div><div class="ttdef"><b>Definition:</b> <a href="pdo__list_8c_source.html#l00329">pdo_list.c:329</a></div></div>
<div class="ttc" id="pdo__list_8c_html_accc8112633a4b76efe8df355d1ad0ec8"><div class="ttname"><a href="pdo__list_8c.html#accc8112633a4b76efe8df355d1ad0ec8">ec_pdo_list_copy</a></div><div class="ttdeci">int ec_pdo_list_copy(ec_pdo_list_t *pl, const ec_pdo_list_t *other)</div><div class="ttdoc">Makes a deep copy of another PDO list. </div><div class="ttdef"><b>Definition:</b> <a href="pdo__list_8c_source.html#l00177">pdo_list.c:177</a></div></div>
<div class="ttc" id="pdo__list_8c_html_a30f05a34cf44b4d4f5bd47db39addb95"><div class="ttname"><a href="pdo__list_8c.html#a30f05a34cf44b4d4f5bd47db39addb95">ec_pdo_list_clear</a></div><div class="ttdeci">void ec_pdo_list_clear(ec_pdo_list_t *pl)</div><div class="ttdoc">PDO list destructor. </div><div class="ttdef"><b>Definition:</b> <a href="pdo__list_8c_source.html#l00061">pdo_list.c:61</a></div></div>
<div class="ttc" id="structec__pdo__list__t_html_a7889b3f485d92c496fd15e45573cae21"><div class="ttname"><a href="structec__pdo__list__t.html#a7889b3f485d92c496fd15e45573cae21">ec_pdo_list_t::list</a></div><div class="ttdeci">struct list_head list</div><div class="ttdoc">List of PDOs. </div><div class="ttdef"><b>Definition:</b> <a href="pdo__list_8h_source.html#l00050">pdo_list.h:50</a></div></div>
<div class="ttc" id="pdo__list_8c_html_aff8b6a50972c7106457f0db17fbeaf6c"><div class="ttname"><a href="pdo__list_8c.html#aff8b6a50972c7106457f0db17fbeaf6c">ec_pdo_list_clear_pdos</a></div><div class="ttdeci">void ec_pdo_list_clear_pdos(ec_pdo_list_t *pl)</div><div class="ttdoc">Clears the list of mapped PDOs. </div><div class="ttdef"><b>Definition:</b> <a href="pdo__list_8c_source.html#l00070">pdo_list.c:70</a></div></div>
<div class="ttc" id="pdo_8c_html_a0766e8e7b4f607aa3b8ce3320198c23b"><div class="ttname"><a href="pdo_8c.html#a0766e8e7b4f607aa3b8ce3320198c23b">ec_pdo_init</a></div><div class="ttdeci">void ec_pdo_init(ec_pdo_t *pdo)</div><div class="ttdoc">PDO constructor. </div><div class="ttdef"><b>Definition:</b> <a href="pdo_8c_source.html#l00046">pdo.c:46</a></div></div>
<div class="ttc" id="pdo__list_8c_html_a6cdf2367204e4db2dcdac339be67aaed"><div class="ttname"><a href="pdo__list_8c.html#a6cdf2367204e4db2dcdac339be67aaed">ec_pdo_list_count</a></div><div class="ttdeci">unsigned int ec_pdo_list_count(const ec_pdo_list_t *pl)</div><div class="ttdoc">Get the number of PDOs in the list. </div><div class="ttdef"><b>Definition:</b> <a href="pdo__list_8c_source.html#l00311">pdo_list.c:311</a></div></div>
<div class="ttc" id="globals_8h_html"><div class="ttname"><a href="globals_8h.html">globals.h</a></div><div class="ttdoc">Global definitions and macros. </div></div>
<div class="ttc" id="structec__pdo__entry__t_html"><div class="ttname"><a href="structec__pdo__entry__t.html">ec_pdo_entry_t</a></div><div class="ttdoc">PDO entry description. </div><div class="ttdef"><b>Definition:</b> <a href="pdo__entry_8h_source.html#l00048">pdo_entry.h:48</a></div></div>
<div class="ttc" id="master_8h_html"><div class="ttname"><a href="master_8h.html">master.h</a></div><div class="ttdoc">EtherCAT master structure. </div></div>
<div class="ttc" id="pdo_8c_html_a2fdbc33334b65a05865e9df69df1737c"><div class="ttname"><a href="pdo_8c.html#a2fdbc33334b65a05865e9df69df1737c">ec_pdo_clear</a></div><div class="ttdeci">void ec_pdo_clear(ec_pdo_t *pdo)</div><div class="ttdoc">PDO destructor. </div><div class="ttdef"><b>Definition:</b> <a href="pdo_8c_source.html#l00094">pdo.c:94</a></div></div>
<div class="ttc" id="structec__pdo__t_html_ae319ba9b8bed2ac49cf6596ff690cfdd"><div class="ttname"><a href="structec__pdo__t.html#ae319ba9b8bed2ac49cf6596ff690cfdd">ec_pdo_t::index</a></div><div class="ttdeci">uint16_t index</div><div class="ttdoc">PDO index. </div><div class="ttdef"><b>Definition:</b> <a href="pdo_8h_source.html#l00051">pdo.h:51</a></div></div>
<div class="ttc" id="pdo__list_8h_html"><div class="ttname"><a href="pdo__list_8h.html">pdo_list.h</a></div><div class="ttdoc">EtherCAT PDO list structure. </div></div>
<div class="ttc" id="pdo_8c_html_aa3110f0f43df1aa859a25a7a53be431c"><div class="ttname"><a href="pdo_8c.html#aa3110f0f43df1aa859a25a7a53be431c">ec_pdo_init_copy</a></div><div class="ttdeci">int ec_pdo_init_copy(ec_pdo_t *pdo, const ec_pdo_t *other_pdo)</div><div class="ttdoc">PDO copy constructor. </div><div class="ttdef"><b>Definition:</b> <a href="pdo_8c_source.html#l00062">pdo.c:62</a></div></div>
<div class="ttc" id="pdo__list_8c_html_a464a658cdd2744493d9e63d033db4d36"><div class="ttname"><a href="pdo__list_8c.html#a464a658cdd2744493d9e63d033db4d36">ec_pdo_list_total_size</a></div><div class="ttdeci">uint16_t ec_pdo_list_total_size(const ec_pdo_list_t *pl)</div><div class="ttdoc">Calculates the total size of the mapped PDO entries. </div><div class="ttdef"><b>Definition:</b> <a href="pdo__list_8c_source.html#l00087">pdo_list.c:87</a></div></div>
<div class="ttc" id="structec__pdo__t_html"><div class="ttname"><a href="structec__pdo__t.html">ec_pdo_t</a></div><div class="ttdoc">PDO description. </div><div class="ttdef"><b>Definition:</b> <a href="pdo_8h_source.html#l00049">pdo.h:49</a></div></div>
<div class="ttc" id="pdo__list_8c_html_a1e0dfffa35df484b25834003b447e888"><div class="ttname"><a href="pdo__list_8c.html#a1e0dfffa35df484b25834003b447e888">ec_pdo_list_add_pdo_copy</a></div><div class="ttdeci">int ec_pdo_list_add_pdo_copy(ec_pdo_list_t *pl, const ec_pdo_t *pdo)</div><div class="ttdoc">Add the copy of an existing PDO to the list. </div><div class="ttdef"><b>Definition:</b> <a href="pdo__list_8c_source.html#l00141">pdo_list.c:141</a></div></div>
<div class="ttc" id="structec__pdo__entry__t_html_a589e58c4f0eb47d8916a3da125d09176"><div class="ttname"><a href="structec__pdo__entry__t.html#a589e58c4f0eb47d8916a3da125d09176">ec_pdo_entry_t::bit_length</a></div><div class="ttdeci">uint8_t bit_length</div><div class="ttdoc">entry length in bit </div><div class="ttdef"><b>Definition:</b> <a href="pdo__entry_8h_source.html#l00053">pdo_entry.h:53</a></div></div>
<div class="ttc" id="structec__pdo__t_html_aaac321c4f80081e5f69e2ff30eac80e5"><div class="ttname"><a href="structec__pdo__t.html#aaac321c4f80081e5f69e2ff30eac80e5">ec_pdo_t::entries</a></div><div class="ttdeci">struct list_head entries</div><div class="ttdoc">List of PDO entries. </div><div class="ttdef"><b>Definition:</b> <a href="pdo_8h_source.html#l00054">pdo.h:54</a></div></div>
<div class="ttc" id="pdo__list_8c_html_a19d7263b2fa2234b9d8301515528e834"><div class="ttname"><a href="pdo__list_8c.html#a19d7263b2fa2234b9d8301515528e834">ec_pdo_list_add_pdo</a></div><div class="ttdeci">ec_pdo_t * ec_pdo_list_add_pdo(ec_pdo_list_t *pl, uint16_t index)</div><div class="ttdoc">Add a new PDO to the list. </div><div class="ttdef"><b>Definition:</b> <a href="pdo__list_8c_source.html#l00117">pdo_list.c:117</a></div></div>
<div class="ttc" id="globals_8h_html_aed23297031f2f23bb5d005bb586790cf"><div class="ttname"><a href="globals_8h.html#aed23297031f2f23bb5d005bb586790cf">EC_ERR</a></div><div class="ttdeci">#define EC_ERR(fmt, args...)</div><div class="ttdoc">Convenience macro for printing EtherCAT-specific errors to syslog. </div><div class="ttdef"><b>Definition:</b> <a href="globals_8h_source.html#l00227">globals.h:227</a></div></div>
<div class="ttc" id="pdo__list_8c_html_ac6f343a6f07a1f817fc0c8820fbd5314"><div class="ttname"><a href="pdo__list_8c.html#ac6f343a6f07a1f817fc0c8820fbd5314">ec_pdo_list_init</a></div><div class="ttdeci">void ec_pdo_list_init(ec_pdo_list_t *pl)</div><div class="ttdoc">PDO list constructor. </div><div class="ttdef"><b>Definition:</b> <a href="pdo__list_8c_source.html#l00050">pdo_list.c:50</a></div></div>
<div class="ttc" id="slave__config_8h_html"><div class="ttname"><a href="slave__config_8h.html">slave_config.h</a></div><div class="ttdoc">EtherCAT slave configuration structure. </div></div>
<div class="ttc" id="pdo__list_8c_html_ac05fc5ee2cf2afdf8b8501ef194c4002"><div class="ttname"><a href="pdo__list_8c.html#ac05fc5ee2cf2afdf8b8501ef194c4002">ec_pdo_list_equal</a></div><div class="ttdeci">int ec_pdo_list_equal(const ec_pdo_list_t *pl1, const ec_pdo_list_t *pl2)</div><div class="ttdoc">Compares two PDO lists. </div><div class="ttdef"><b>Definition:</b> <a href="pdo__list_8c_source.html#l00207">pdo_list.c:207</a></div></div>
<div class="ttc" id="pdo__list_8c_html_af7e65b2de439049f0f2b2cdfd1618187"><div class="ttname"><a href="pdo__list_8c.html#af7e65b2de439049f0f2b2cdfd1618187">ec_pdo_list_find_pdo_by_pos_const</a></div><div class="ttdeci">const ec_pdo_t * ec_pdo_list_find_pdo_by_pos_const(const ec_pdo_list_t *pl, unsigned int pos)</div><div class="ttdoc">Finds a PDO via its position in the list. </div><div class="ttdef"><b>Definition:</b> <a href="pdo__list_8c_source.html#l00289">pdo_list.c:289</a></div></div>
<div class="ttc" id="structec__pdo__t_html_aa7e6a0e0405c93414052c6d998d604ad"><div class="ttname"><a href="structec__pdo__t.html#aa7e6a0e0405c93414052c6d998d604ad">ec_pdo_t::list</a></div><div class="ttdeci">struct list_head list</div><div class="ttdoc">List item. </div><div class="ttdef"><b>Definition:</b> <a href="pdo_8h_source.html#l00050">pdo.h:50</a></div></div>
<div class="ttc" id="pdo__list_8c_html_ab08f37fcf3beda7d5425d49eca02c3be"><div class="ttname"><a href="pdo__list_8c.html#ab08f37fcf3beda7d5425d49eca02c3be">ec_pdo_list_find_pdo</a></div><div class="ttdeci">ec_pdo_t * ec_pdo_list_find_pdo(const ec_pdo_list_t *pl, uint16_t index)</div><div class="ttdoc">Finds a PDO with the given index. </div><div class="ttdef"><b>Definition:</b> <a href="pdo__list_8c_source.html#l00243">pdo_list.c:243</a></div></div>
<div class="ttc" id="pdo_8h_html"><div class="ttname"><a href="pdo_8h.html">pdo.h</a></div><div class="ttdoc">EtherCAT Process data object structure. </div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_c1346cf4828efdd0d2baf0d391d01b77.html">master</a></li><li class="navelem"><a class="el" href="pdo__list_8c.html">pdo_list.c</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li>
  </ul>
</div>
</body>
</html>
